<?php
/**
 * @version      BOSSCMS-Free
 * @trademark    BOSSCMS
 * @copyright    Copyright © by BOSSCMS-Free (https://www.bosscms.net/) 保留所有权利
 * @license      https://gitee.com/Greenpeas/BOSSCMS/license/ 和 https://www.bosscms.net/freelicense/
 * @link         https://www.bosscms.net/
 * @author       温州软界网络技术有限公司
**/
defined('IS_OK') or exit('Access Forbidden');

into::basic_class('admin');

class view extends admin
{	
	public function init()
	{
		global $G;
		$G['cover'] = $this->cover('content');
		$G['body_class'] = 'iframe-content';
		$G['navsub'] = into::load_class('admin','items','content','new')->navsub();
		$data = array();
		$core = $G['get']['core'];
		if(preg_match('/^\w+$/',$core)){
			$data['ctrl'] = theme::core_series($core, 0, null);
			$result = mysql::select_all('core,name,value','theme',"extent='0' AND core='{$core}' AND parent='0'");
			foreach($result as $v){
			    $data[$v['core']][$v['name']] = $v["value"];
			}
		}
		echo $this->theme('view/view', $data);
	}

	public function add()
	{
		global $G;
		$this->cover('content','M');
		if($tc = $G['post']['tc']){
			value::set($tc, 0, 0);
			alert('操作成功', url::mpf('view','view','init'));
		}else{
			alert('没有提交信息');
		}
	}
}
?>